Crate dlc

source ·
Expand description

Rust DLC Library

Library for creating, signing and verifying transactions for the Discreet Log Contract protocol.

Modules

Module for working with DLC channels
Crypto utilities providing necessary DLC specific functions not available in rust-secp256k1 or rust-secp256k1-zkp.
Utility functions not uniquely related to DLC

Structs

Contains the necessary transactions for establishing a DLC
Representation of a payout for an enumeration outcome.
Structure containing oracle information for a single event.
Contains the parameters required for creating DLC transactions for a single party. Specifically these are the common fields between Offer and Accept messages.
Represents the payouts for a unique contract outcome. Offer party represents the initiator of the contract while accept party represents the party accepting the contract.
Representation of a set of contiguous outcomes that share a single payout.
Contains info about a utxo used for funding a DLC contract

Enums

An error code.

Constants

Functions

Create a contract execution transaction
Create an adaptor signature for the given cet using the provided oracle infos.
Create an adaptor signature for the given cet using the provided adaptor point.
Crerate a set of adaptor signatures for the given cet/message pairs.
Crerate a set of adaptor signatures for the given cet/message pairs.
Create a set of contract execution transaction for each provided outcome
Create the transactions for a DLC contract based on the provided parameters
Create a funding transaction
Create a refund transaction
Get an adaptor point generated using the given oracle information and messages.
Create the multisig redeem script for the funding output
Sign the given cet using own private key, adapt the counter party signature and place both signatures and the funding multi sig script pubkey on the witness stack
Verify that a given adaptor signature for a given cet is valid with respect to an oracle public key, nonce and a given message.
Verify that a given adaptor signature for a given cet is valid with respect to an adaptor point.
Verify a signature for a given transaction input.